package com.icetech.eom.service.ws;

import com.icetech.commonbase.JsonTools;
import com.icetech.eom.common.annotation.SystemLog;
import com.icetech.eom.domain.response.WebServiceResponse;
import com.icetech.eom.service.Spring;
import com.icetech.eom.service.ws.cust.SpringSendSmgServer;
import lombok.extern.slf4j.Slf4j;

/**
 * 发送短信接口
 * @author wangzw
 */
@Slf4j
public class SendSmgServer  {

    @SystemLog(description = "<web service>发送短信")
    public String Send(String para) {
        SpringSendSmgServer springSendSmgServer;
        WebServiceResponse webServiceResponse = new WebServiceResponse();
        try {
            springSendSmgServer = Spring.getBean("springSendSmgServer");
            String reslut = springSendSmgServer.sendMsg(para);
            return reslut;
        } catch (Exception e) {
            webServiceResponse.setState(-1+"");
            webServiceResponse.setRetmsg("系统异常");
            return JsonTools.toString(webServiceResponse);
        }
    }

    public String ChkSMS(String para) {
        SpringSendSmgServer springSendSmgServer;
        WebServiceResponse webServiceResponse = new WebServiceResponse();
        try {
            springSendSmgServer = Spring.getBean("springSendSmgServer");
            String reslut = springSendSmgServer.checkSmg(para);
            return reslut;
        } catch (Exception e) {
            webServiceResponse.setState(-1+"");
            webServiceResponse.setRetmsg("系统异常");
            return JsonTools.toString(webServiceResponse);
        }
    }
}
